﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class controls_Footer : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        using (DataSet dsFooterList = new DataSet())
        {
            dsFooterList.ReadXml(string.Format(@"{0}\assets\xml\FooterList.xml", Request.PhysicalApplicationPath));
            rptFooter.DataSource = dsFooterList.Tables[0];
            rptFooter.DataBind();
        }
    }
    protected void rptFooter_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        DataRowView drv = (DataRowView)e.Item.DataItem;
        using (HyperLink lnk = (HyperLink)e.Item.FindControl("lnkFooter"))
        {
            lnk.Text = Convert.ToString(drv["Title"]);
            lnk.NavigateUrl = string.Format(@"~{0}", drv["Url"]);
        }
    }
}
